<template>
  <div>
    <button @click="addBtn">+</button>
    <span>{{ value }}</span>
    <button @click="delBtn">-</button>
  </div>
</template>

<script>
export default {
  methods: {
    addBtn() {
      this.$emit('input', this.value + 1)
    },
    delBtn() {
      this.$emit('input', this.value - 1)
    },
  },
  props: {
    value: {
      type: Number,
      required: true,
    },
  },
}
</script>

<style lang="less" scoped>
span {
  display: inline-block;
  margin: 0 5px;
}
</style>
